<!doctype html>
<html>

<head>
    <meta charset="utf-8">

    <script>
        function start_alert() {
            window.alert("是你叫我么?");
        }
        function write_func() {
            document.write("我是一个粉刷匠.....");
        }
        function console_info() {
            console.log("你点击了按钮,我就在控制台打印了.....");
        }
    </script>

</head>

<h1 id="title">js输出代码</h1>
<h2>alert输出</h2>
<button onclick=start_alert()>点击此按钮,调起警告框</button>
<br>
<h2>write输出</h2>
<button onclick=write_func()>点击此按钮,使用write</button>
<script>
    document.write("你好,我叫坚果...");
</script>
<h2>console输出</h2>
<button onclick="console_info()">点击此按钮,控制台输出一句话</button>
</html>